---
title: "Replication for: Sustainable finance literacy predicts investment behavior beyond general financial literacy: Evidence from two representative samples"
author: "Marcel Seifert"
format: html
editor: visual
echo: false
toc: true
toc-title: "Table of Contents"
---

```{r message = F, warning = F}


library(dplyr)
library(here)
library(tibble) #to add columns
library(DescTools) #alpha
library(modelsummary) # export tables
library(flextable) #convert to flextable and export to word
library(arsenal)
library(sjPlot) #for corrtab
library(GPArotation) # EFA
library(EFAtools) #EFA
library(lavaan) # CFA, SEM
library(car) #linearhypothesis
library(fixest) #fixest
library(MASS) #polr
library(DT) #data table


source(here("data_management.R"))




```

# Study 1

## Difficulty index / discrimination index

```{r}

#upper group/lower group
number_of_participants <- round(nrow(data_study1) * 0.27,0)


data_diff <- data_study1

#create df with upper and lower participants
top_participants <- head(data_diff[order(data_diff$SFL30, decreasing = TRUE), ], number_of_participants)
low_participants <- head(data_diff[order(data_diff$SFL30, decreasing = FALSE), ], number_of_participants)

# Calculate the sum of correct responses for these participants
difficulty_index <- data.frame(variable = c(1:30))


difficulty_index$lower_group_correct <- c(sum(low_participants$i1_correct, na.rm = TRUE),
                                          sum(low_participants$i2_correct, na.rm = TRUE),
                                          sum(low_participants$i3_correct, na.rm = TRUE),
                                          sum(low_participants$i4_correct, na.rm = TRUE),
                                          sum(low_participants$i5_correct, na.rm = TRUE),
                                          sum(low_participants$i6_correct, na.rm = TRUE),
                                          sum(low_participants$i7_correct, na.rm = TRUE),
                                          sum(low_participants$i8_correct, na.rm = TRUE),
                                          sum(low_participants$i9_correct, na.rm = TRUE),
                                          sum(low_participants$i10_correct, na.rm = TRUE),
                                          sum(low_participants$i11_correct, na.rm = TRUE),
                                          sum(low_participants$i12_correct, na.rm = TRUE),
                                          sum(low_participants$i13_correct, na.rm = TRUE),
                                          sum(low_participants$i14_correct, na.rm = TRUE),
                                          sum(low_participants$i15_correct, na.rm = TRUE),
                                          sum(low_participants$i16_correct, na.rm = TRUE),
                                          sum(low_participants$i17_correct, na.rm = TRUE),
                                          sum(low_participants$i18_correct, na.rm = TRUE),
                                          sum(low_participants$i19_correct, na.rm = TRUE),
                                          sum(low_participants$i20_correct, na.rm = TRUE),
                                          sum(low_participants$i21_correct, na.rm = TRUE),
                                          sum(low_participants$i22_correct, na.rm = TRUE),
                                          sum(low_participants$i23_correct, na.rm = TRUE),
                                          sum(low_participants$i24_correct, na.rm = TRUE),
                                          sum(low_participants$i25_correct, na.rm = TRUE),
                                          sum(low_participants$i26_correct, na.rm = TRUE),
                                          sum(low_participants$i27_correct, na.rm = TRUE),
                                          sum(low_participants$i28_correct, na.rm = TRUE),
                                          sum(low_participants$i29_correct, na.rm = TRUE),
                                          sum(low_participants$i30_correct, na.rm = TRUE))


difficulty_index$upper_group_correct <- c(sum(top_participants$i1_correct, na.rm = TRUE),
                                          sum(top_participants$i2_correct, na.rm = TRUE),
                                          sum(top_participants$i3_correct, na.rm = TRUE),
                                          sum(top_participants$i4_correct, na.rm = TRUE),
                                          sum(top_participants$i5_correct, na.rm = TRUE),
                                          sum(top_participants$i6_correct, na.rm = TRUE),
                                          sum(top_participants$i7_correct, na.rm = TRUE),
                                          sum(top_participants$i8_correct, na.rm = TRUE),
                                          sum(top_participants$i9_correct, na.rm = TRUE),
                                          sum(top_participants$i10_correct, na.rm = TRUE),
                                          sum(top_participants$i11_correct, na.rm = TRUE),
                                          sum(top_participants$i12_correct, na.rm = TRUE),
                                          sum(top_participants$i13_correct, na.rm = TRUE),
                                          sum(top_participants$i14_correct, na.rm = TRUE),
                                          sum(top_participants$i15_correct, na.rm = TRUE),
                                          sum(top_participants$i16_correct, na.rm = TRUE),
                                          sum(top_participants$i17_correct, na.rm = TRUE),
                                          sum(top_participants$i18_correct, na.rm = TRUE),
                                          sum(top_participants$i19_correct, na.rm = TRUE),
                                          sum(top_participants$i20_correct, na.rm = TRUE),
                                          sum(top_participants$i21_correct, na.rm = TRUE),
                                          sum(top_participants$i22_correct, na.rm = TRUE),
                                          sum(top_participants$i23_correct, na.rm = TRUE),
                                          sum(top_participants$i24_correct, na.rm = TRUE),
                                          sum(top_participants$i25_correct, na.rm = TRUE),
                                          sum(top_participants$i26_correct, na.rm = TRUE),
                                          sum(top_participants$i27_correct, na.rm = TRUE),
                                          sum(top_participants$i28_correct, na.rm = TRUE),
                                          sum(top_participants$i29_correct, na.rm = TRUE),
                                          sum(top_participants$i30_correct, na.rm = TRUE))


difficulty_index$total_correct <- difficulty_index$lower_group_correct + difficulty_index$upper_group_correct
difficulty_index$difficulty_index <- round(difficulty_index$total_correct / (number_of_participants*2), 3)
#acutally this should be divided by all who tried while we use all participants
#as we cannot infer who "tried"

difficulty_index$diff_below_good <- ifelse(difficulty_index$difficulty_index < 0.22, "below", "okay")

# difference btw upper and lower group in corr responses
difficulty_index$diff_in_corr <- (difficulty_index$upper_group_correct-difficulty_index$lower_group_correct)

difficulty_index$discrimination_index <- round(difficulty_index$diff_in_corr / number_of_participants, 3)
difficulty_index$discr_below_good <- ifelse(difficulty_index$discrimination_index < 0.20, "below", "okay")



#rename
x <- data_study1 %>% subset(select = c(i1_SFL_ESG_meaning:i30_SFL_banks_recoded))

difficulty_index$variable <- colnames(x)
rm(x)

# Create a flextable
flextable_obj <- flextable(difficulty_index)

flextable_obj


```

## Descriptives

```{r, results = "asis"}


data_table <- data_study1 %>% subset(select =c(SFL7, FL_basic, FL_advanced, sust_literacy))

attr(data_table$SFL7, "label") <- "SFL"


tabl <- tableby( ~ ., data = data_table, numeric.stats = c("meansd"), 
                numeric.simplify=T)

summary(tabl, text = T, digits = 2)

```

## Correlation table

```{r}

corr_table_variables <- data_study1 %>% subset(select = c(SFL7, SFL27, SFL5, SFL30,
                                                          FL_basic, FL_advanced, sust_literacy,
                                                          subjective_SFL,
                                                          subjective_basic_FL, subjective_advanced_FL,
                                                          subjective_SL,experience,
                                                          education, education_economics,
                                                          stock_market_participant, 
                                                          sustainable_stock_market_participant))


### spearman 
tab_corr(corr_table_variables,
         na.deletion = c("pairwise"),
         p.numeric = F,
         show.p = T,
         corr.method = c("spearman"),
         triangle = "lower",
         digits = 2, 
         remove.spaces = T)



```

## Exploratory factor analysis

```{r, include = FALSE}

## EFA -------------------

PCA1_data <- data_study1 %>% subset(select = c(i1_SFL_ESG_meaning:
                                                 i30_SFL_banks_recoded))%>% 
  dplyr::select(-c(contains("correct"))) %>% 
  relocate(i9_SFL_name_recoded, .after = i30_SFL_banks_recoded) %>% 
  relocate(i21_SFL_impact_environment_recoded, .after = i9_SFL_name_recoded)%>% 
  relocate(i23_SFL_impact_investments_recoded, 
           .after = i21_SFL_impact_environment_recoded)  


# 4 factor solution
#fa.parallel(PCA1_data, fa = "both")
#fa.parallel(PCA1_data_wt_NA, fa = "both")


EFA_psych_paf <- EFA(PCA1_data, n_factors = 4, type = "SPSS", rotation = "promax",
                     use = "complete.obs",
                     n_iter = 25)

print(EFA_psych_paf)
EFA_psych_paf$Structure

EFA_result <- data.frame(EFA_psych_paf$Structure[1:30,1:4])
EFA_result$items <- rownames(EFA_result)

EFA_result <- EFA_result %>% relocate(items, .before = "X1")



############ PCA 2 

PCA2_data <- data_study1 %>% subset(select = c(i1_SFL_ESG_meaning:
                                                 i30_SFL_banks_recoded))%>% 
  dplyr::select(-c(contains("correct"))) %>% dplyr::select(-c(contains("recoded")))



EFA_psych_paf <- EFA(PCA2_data, n_factors = 2, type = "SPSS", rotation = "promax",
                     use = "complete.obs",
                     n_iter = 25)
print(EFA_psych_paf)
EFA_psych_paf$Structure

x <- data.frame(EFA_psych_paf$Structure[1:20,1:2])
x$items <- rownames(x)

EFA_result <- full_join(EFA_result, x, by = "items")



############ PCA 3

PCA3_data <- data_study1 %>% subset(select = c(i1_SFL_ESG_meaning:
                                                 i30_SFL_banks_recoded))%>% 
  dplyr::select(-c(contains("correct"))) %>% dplyr::select(-c(contains("recoded")))


EFA_psych_paf <- EFA(PCA3_data, n_factors = 1, type = "SPSS",
                     use = "complete.obs",
                     n_iter = 25)
print(EFA_psych_paf)
EFA_psych_paf$unrot_loadings


x <- data.frame(EFA_psych_paf$unrot_loadings[1:20,1])
x$items <- rownames(x)

EFA_result <- full_join(EFA_result, x, by = "items")
rm(x)

EFA_result <- EFA_result %>% rename("PCA1_1" = "X1.x",
                                    "PCA1_2" = "X2.x",
                                    "PCA1_3" = "X3",
                                    "PCA1_4" = "X4",
                                    "PCA2_1" = "X1.y",
                                    "PCA2_2" = "X2.y",
                                    "PCA3_1" = 
                                      "EFA_psych_paf.unrot_loadings.1.20..1.")


EFA_result$PCA1_1 <- round(EFA_result$PCA1_1, 3)
EFA_result$PCA1_2 <- round(EFA_result$PCA1_2, 3)
EFA_result$PCA1_3 <- round(EFA_result$PCA1_3, 3)
EFA_result$PCA1_4 <- round(EFA_result$PCA1_4, 3)
EFA_result$PCA2_1 <- round(EFA_result$PCA2_1, 3)
EFA_result$PCA2_2 <- round(EFA_result$PCA2_2, 3)
EFA_result$PCA3_1 <- round(EFA_result$PCA3_1, 3)

```

```{r}
datatable(EFA_result)


```

## Confirmatory factor analysis

### One factor

```{r, inlcude = FALSE}

model <- 'Factor1 =~ SFLi3_correct +SFLi4_correct +
SFLi5_correct+SFLi12_correct+SFLi16_correct+SFLi19_correct+SFLi26_correct'

fit <- cfa(model, data)
fit_measures <- fitMeasures(fit)

fits <- data.frame(Chisquare = round(fit_measures["chisq"],2),
                   DF = round(fit_measures["df"],2), 
                   pvalue = round(fit_measures["pvalue"],2), 
                   RMSEA = round(fit_measures["rmsea"],2), 
                   CFI = round(fit_measures["cfi"],2),
                   TLI = round(fit_measures["tli"],2),
                   SRMR = round(fit_measures["srmr"],2))

```

```{r}

datatable(fits)

```

### Two factors

```{r, inlcude = FALSE}

model <- 'Factor1 =~ SFLi3_correct +SFLi4_correct +
SFLi5_correct+SFLi12_correct+SFLi16_correct
Factor2 =~ SFLi19_correct+SFLi26_correct'

fit <- cfa(model, data)
fit_measures <- fitMeasures(fit)

fits <- data.frame(Chisquare = round(fit_measures["chisq"],2),
                   DF = round(fit_measures["df"],2), 
                   pvalue = round(fit_measures["pvalue"],2), 
                   RMSEA = round(fit_measures["rmsea"],2), 
                   CFI = round(fit_measures["cfi"],2),
                   TLI = round(fit_measures["tli"],2),
                   SRMR = round(fit_measures["srmr"],2))

```

```{r}
datatable(fits)

```

## SFL and self-reported (sustainable) investments (Study)

```{r}

m1 = glm(sustainable_stock_market_participant ~ SFL7 + FL_basic+FL_advanced +sust_literacy,
         family = "binomial", data_study1)
m2 = glm(sustainable_stock_market_participant ~ SFL7 + FL_basic+FL_advanced +sust_literacy + 
           gender + age + university_degree + high_income + hhincome_not_reported,
         family = "binomial", data_study1)
m3 = glm(sustainable_stock_market_participant ~ SFL7 + FL_basic+FL_advanced +sust_literacy + 
           gender + age + university_degree + high_income + hhincome_not_reported + 
           hassle_inv+ hassle_sust+ sust_lifestyle + 
           climate_awareness+ education_economics+ prof_experience, family = "binomial", data_study1)
m4 = glm(stock_market_participant ~ SFL7 + FL_basic+FL_advanced +sust_literacy,
         family = "binomial", data_study1)
m5 = glm(stock_market_participant ~ SFL7 + FL_basic+FL_advanced +sust_literacy + 
           gender + age + university_degree + high_income + hhincome_not_reported,
         family = "binomial", data_study1)
m6 = glm(stock_market_participant ~ SFL7 + FL_basic+FL_advanced +sust_literacy + 
           gender + age + university_degree + high_income + hhincome_not_reported + 
           hassle_inv+ hassle_sust+ sust_lifestyle + 
           climate_awareness+ education_economics+ prof_experience, family = "binomial", data_study1)

cm <- c("SFL7" = "Sustainable finance literacy (7 items)",
        "FL_basic" = "Basic financial literacy objective",
        "FL_advanced" = "Advanced financial literacy objective",
        "sust_literacy" = "Sustainability literacy objective",
        "gender" = "Gender: female",
        "age" = "Age",
        "university_degree" = "University degree: yes", 
        "high_income" = "Household income above median",
        "hhincome_not_reported" = "Household income not reported",
        "education_economics" = "Education in economics",
        "prof_experience" = "Professional experience with investments",
        "hassle_inv" = "Hassle factor investments",
        "hassle_sust" = "Hassle factor sustainable investments",
        "sust_lifestyle" = "Sustainable lifestyle",
        "climate_awareness" = "Climate change awareness", 
        "(Intercept)" = "Constant")




modelsummary(list(m4,m5,m6, m1, m2, m3), coef_map = cm,
             stars = c("+" = .1, "*" = .05, "**" = .01, "***" = .001))


```

# Study 2

## Descriptives

```{r results = "asis"}

data_table <- data %>% subset(select=c(sfl, FL_advanced, SMP_investment_decision,
                         SI_investment_decision, GW_investment_decision,
                         investmentdecision_A, investmentdecision_B, 
                         investmentdecision_C, investmentdecision_D, 
                         investmentdecision_S,manipcheckrating_A,
                         manipcheckrating_B,
                         manipcheckrating_C,
                         manipcheckrating_D,
                         manipcheckrating_S,
                         manipcheckgw))


attr(data_table$sfl, "label") <- "SFL"
attr(data_table$FL_advanced, "label") <- "Advanced financial literacy"
attr(data_table$SMP_investment_decision, "label") <- "Stock market investments"
attr(data_table$SI_investment_decision, "label") <- "Sustainable investments"
attr(data_table$GW_investment_decision, "label") <- "Greenwashed investments"
attr(data_table$investmentdecision_A, "label") <- "Investment Fund A"
attr(data_table$investmentdecision_B, "label") <- "Investment Fund B"
attr(data_table$investmentdecision_C, "label") <- "Investment Fund C"
attr(data_table$investmentdecision_D, "label") <- "Investment Fund D"
attr(data_table$investmentdecision_S, "label") <- "Investment Savings account"
attr(data_table$manipcheckrating_A, "label") <- "Follow up rating: Fund A"
attr(data_table$manipcheckrating_B, "label") <- "Follow up rating: Fund B"
attr(data_table$manipcheckrating_C, "label") <- "Follow up rating: Fund C"
attr(data_table$manipcheckrating_D, "label") <- "Follow up rating: Fund D"
attr(data_table$manipcheckrating_S, "label") <- "Follow up rating: Savings account"
attr(data_table$manipcheckgw, "label") <- "Follow up: Greenwashing identification"



tabl <- tableby( ~ ., data = data_table, numeric.stats = c("meansd"), 
                numeric.simplify=T)

summary(tabl, text = T, digits = 2)

```

## Models stock market investment

```{r}

m1 <- lm(SMP_investment_decision ~ sfl + FL_advanced, data)


m2 <- lm(SMP_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported + 
           experience, data)

m3 <- lm(SMP_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported + 
           experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg, data)

m4 <- lm(SMP_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported + 
           experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg + 
           hassle_sust + gw_belief, data)

m5 <- lm(SMP_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported + 
           experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg + 
           hassle_sust + gw_belief + bio_values + alt_values + risk_taking + 
           patience + trust_general + 
           left_wing , data)

m6 <- lm(SMP_investment_decision ~ sfl, data)
m7 <- lm(SMP_investment_decision ~ FL_advanced, data)

cm <- c("sfl" = "Sustainable finance literacy",
        "FL_advanced" = "Advanced financial literacy",
        "gender" = "Female (ref = male)",
        "age" = "Age in years",
        "university_degree" = "University degree (ref = no)",
        "high_income" = "High household income",
        "hhincome_not_reported" = "Household income not reported",
        "experience" = "Investment experience in years",
        "SHI" = "Stockholder image",
        "SMI_immorality" = "Stock market image: Immorality",
        "SMI_wealth_creation" = "Stock market image: Wealth creation",
        "SMI_esg" = "Stock market image: ESG",
        "hassle_sust" = "Hassle factor",
        "gw_belief" = "Greenwashing beliefs",
        "bio_values" = "Biospheric Values",
        "alt_values" = "Altruistic Values",
        "risk_taking" = "Risk taking",
        "patience" = "Patience",
        "trust_general" = "General trust",
        "left_wing" = "Left wing views",
        "(Intercept)" = "Constant")


row <- data.frame(term = "Wald test: SFL = Advanced FL", m7 = "", m6 = "", 
                  m1 = linearHypothesis(m1, "sfl = FL_advanced")[2,"Pr(>F)"],
                  m2 = linearHypothesis(m2, "sfl = FL_advanced")[2,"Pr(>F)"],
                  m3 = linearHypothesis(m3, "sfl = FL_advanced")[2,"Pr(>F)"],
                  m4 = linearHypothesis(m4, "sfl = FL_advanced")[2,"Pr(>F)"],
                  m5 = linearHypothesis(m5, "sfl = FL_advanced")[2,"Pr(>F)"])


gof_map <- c(
  n = "nobs",
  r2 = "r.squared",
  "r2 adj" = "adj.r.squared"
)


modelsummary(list(m7,m6,m1, m2,m3,m4,m5), add_rows = row, 
             coef_map = cm, gof_map = gof_map,
             stars = c("+" = .1, "*" = .05, "**" = .01, "***" = .001))
```

## Models stock market investment: additional tests

### Additional variance explained

```{r}
anova(m6, m1)
anova(m7, m1)

```

## Models sustainble investment

```{r}


m1 <- lm(SI_investment_decision ~ sfl + FL_advanced, data)

m2 <- lm(SI_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported + 
           experience, data)

m3 <- lm(SI_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported + 
           experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg, data)

m4 <- lm(SI_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported + 
           experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg +
           hassle_sust + gw_belief, data)

m5 <- lm(SI_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported + 
           experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg + 
           hassle_sust + gw_belief +  bio_values + alt_values + risk_taking + 
           patience + trust_general + 
           left_wing, data)

m6 <- lm(SI_investment_decision ~ sfl, data)
m7 <- lm(SI_investment_decision ~ FL_advanced, data)

row <- data.frame(term = "Wald test: SFL = Advanced FL", m7 = "", m6 = "", 
                  m1 = linearHypothesis(m1, "sfl = FL_advanced")[2,"Pr(>F)"],
                  m2 = linearHypothesis(m2, "sfl = FL_advanced")[2,"Pr(>F)"],
                  m3 = linearHypothesis(m3, "sfl = FL_advanced")[2,"Pr(>F)"],
                  m4 = linearHypothesis(m4, "sfl = FL_advanced")[2,"Pr(>F)"],
                  m5 = linearHypothesis(m5, "sfl = FL_advanced")[2,"Pr(>F)"])


modelsummary(list(m7,m6,m1, m2,m3,m4,m5), add_rows = row, 
             coef_map = cm, gof_map = gof_map,
             stars = c("+" = .1, "*" = .05, "**" = .01, "***" = .001))

```

## Models sustainable investment: additional tests

### Additional variance explained

```{r}
anova(m6, m1)
anova(m7, m1)

```

## Models Potentially Greenwashed

```{r}

data_SI <- data %>% 
  dplyr::filter(SI_investment_decision !=0)

m1 <- lm(GW_investment_decision ~ sfl + FL_advanced, data_SI)


m2 <- lm(GW_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported + 
           experience, data_SI)

m3 <- lm(GW_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported + 
           experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg, data_SI)

m4 <- lm(GW_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported + 
           experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg + hassle_sust + gw_belief, data_SI)

m5 <- lm(GW_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported + 
           experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg + 
           hassle_sust + gw_belief +  bio_values + alt_values + risk_taking + 
           patience + trust_general + left_wing, data_SI)

m6 <- lm(GW_investment_decision ~ sfl, data_SI)
m7 <- lm(GW_investment_decision ~ FL_advanced, data_SI)

row <- data.frame(term = "Wald test: SFL = Advanced FL", m7 = "", m6 = "", 
                  m1 = linearHypothesis(m1, "sfl = FL_advanced")[2,"Pr(>F)"],
                  m2 = linearHypothesis(m2, "sfl = FL_advanced")[2,"Pr(>F)"],
                  m3 = linearHypothesis(m3, "sfl = FL_advanced")[2,"Pr(>F)"],
                  m4 = linearHypothesis(m4, "sfl = FL_advanced")[2,"Pr(>F)"],
                  m5 = linearHypothesis(m5, "sfl = FL_advanced")[2,"Pr(>F)"])

modelsummary(list(m7,m6,m1, m2,m3,m4,m5), add_rows = row, 
             coef_map = cm, gof_map = gof_map,
             stars = c("+" = .1, "*" = .05, "**" = .01, "***" = .001))
```

## Models greenwashed investment: additional tests

### Additional variance explained

```{r}
anova(m6, m1)
anova(m7, m1)

```

## Logistic regression: Greenwashing identification

```{r}


m1 <- glm(gw_identified ~ sfl + FL_advanced, family = "binomial", data_SI)

m2 <- glm(gw_identified ~ sfl + FL_advanced + 
            gender + age + university_degree + high_income + hhincome_not_reported + 
            experience,family = "binomial", data_SI)

m3 <- glm(gw_identified ~ sfl + FL_advanced + 
            gender + age + university_degree + high_income + hhincome_not_reported + 
            experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg,
          family = "binomial", data_SI)

m4 <- glm(gw_identified ~ sfl + FL_advanced + 
            gender + age + university_degree + high_income + hhincome_not_reported + 
            experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg + 
            hassle_sust + gw_belief,family = "binomial", data_SI)

m5 <- glm(gw_identified ~ sfl + FL_advanced + 
            gender + age + university_degree + high_income + hhincome_not_reported + 
            experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg + 
            hassle_sust + gw_belief +   bio_values + alt_values + risk_taking + 
            patience + trust_general + 
            left_wing ,family = "binomial", data_SI)

m6 <- glm(gw_identified ~ sfl, family = "binomial", data_SI)
m7 <- glm(gw_identified ~ FL_advanced, family = "binomial", data_SI)


row <- data.frame(term = "Wald test: SFL = Advanced FL", m7 = "", m6 = "", 
                  m1 = linearHypothesis(m1, "sfl = FL_advanced")[2,"Pr(>Chisq)"],
                  m2 = linearHypothesis(m2, "sfl = FL_advanced")[2,"Pr(>Chisq)"],
                  m3 = linearHypothesis(m3, "sfl = FL_advanced")[2,"Pr(>Chisq)"],
                  m4 = linearHypothesis(m4, "sfl = FL_advanced")[2,"Pr(>Chisq)"],
                  m5 = linearHypothesis(m5, "sfl = FL_advanced")[2,"Pr(>Chisq)"])

row2 <- data.frame(term = "Nagelkerke PseudoR2", #
                   m7 = round(PseudoR2(m7, c("Nagel")),3),
                   m6 = round(PseudoR2(m6, c("Nagel")),3),
                  m1 = round(PseudoR2(m1, c("Nagel")),3),
                  m2 = round(PseudoR2(m2, c("Nagel")),3),
                  m3 = round(PseudoR2(m3, c("Nagel")),3),
                  m4 = round(PseudoR2(m4, c("Nagel")),3),
                  m5 = round(PseudoR2(m5, c("Nagel")),3))

row <- rbind(row, row2)


gof_map_short <- c(
  n = "nobs"
)


modelsummary(list(m7,m6,m1, m2,m3,m4,m5), add_rows = row,
             coef_map = cm, gof_map = gof_map_short,
             stars = c("+" = .1, "*" = .05, "**" = .01, "***" = .001))


```

### Mediation: Stock market investment (incentivized)

```{r}
sem_model <- '
  # Direct paths
  SMP_investment_decision ~ b1*SMI_immorality + b2*SMI_esg + b3*SMI_wealth_creation + b4*SHI +c*sfl
  SMI_immorality ~ a1*sfl
  SMI_esg ~ a2*sfl
  SMI_wealth_creation ~ a3*sfl
  SHI ~ a4*sfl

  # Indirect paths (mediation)
  indirect1 := a1 * b1
  indirect2 := a2 * b2
  indirect3 := a3 * b3
  indirect4 := a4 * b4
  total_indirect := indirect1 + indirect2 + indirect3 + indirect4
  total_effect := c + (indirect1 + indirect2 + indirect3 + indirect4)
'



fit <- sem(sem_model, data = data)

summary(fit, fit.measures = F)


```

### Mediation: Stock market investment (self-reported)

```{r}

data$assets_percent_0_1 <- data$assets_percent/5

sem_model <- '
  # Direct paths
  assets_percent_0_1 ~ b1*SMI_immorality + b2*SMI_esg + b3*SMI_wealth_creation + b4*SHI +c*sfl
  SMI_immorality ~ a1*sfl
  SMI_esg ~ a2*sfl
  SMI_wealth_creation ~ a3*sfl
  SHI ~ a4*sfl

  # Indirect paths (mediation)
  indirect1 := a1 * b1
  indirect2 := a2 * b2
  indirect3 := a3 * b3
  indirect4 := a4 * b4
  total_indirect := indirect1 + indirect2 + indirect3 + indirect4
  total_effect := c + (indirect1 + indirect2 + indirect3 + indirect4)
'



fit <- sem(sem_model, data = data)

summary(fit, fit.measures = F)
```

### Mediation: Sustainable investment (incentivized)

```{r}
sem_model <- '
  # Direct paths
  SI_investment_decision ~ b1*hassle_sust + b2*gw_belief +c*sfl
  hassle_sust ~ a1*sfl
  gw_belief ~ a2*sfl


  # Indirect paths (mediation)
  indirect1 := a1 * b1
  indirect2 := a2 * b2
  total_indirect := indirect1 + indirect2  
  total_effect := c + (indirect1 + indirect2)
'

fit <- sem(sem_model, data = data)

summary(fit, fit.measures = F)


```

### Mediation: Sustainable investment (self-reported)

```{r}

data$assets_sust_percent_0_1 <- data$assets_sust_perc/5

sem_model <- '
  # Direct paths
  assets_sust_percent_0_1 ~ b1*hassle_sust + b2*gw_belief +c*sfl
  hassle_sust ~ a1*sfl
  gw_belief ~ a2*sfl


  # Indirect paths (mediation)
  indirect1 := a1 * b1
  indirect2 := a2 * b2
  total_indirect := indirect1 + indirect2  
  total_effect := c + (indirect1 + indirect2)
'

fit <- sem(sem_model, data = data)

summary(fit, fit.measures = F)
```

### Mediation: Potentially greenwashed investment (incentivized)

```{r}
sem_model <- '
  # Direct paths
  GW_investment_decision ~ b1*subjective_ability_SFL + b2*gw_belief +c*sfl
  subjective_ability_SFL ~ a1*sfl
  gw_belief ~ a2*sfl


  # Indirect paths (mediation)
  indirect1 := a1 * b1
  indirect2 := a2 * b2
  total_indirect := indirect1 + indirect2  
  total_effect := c + (indirect1 + indirect2)
'

fit <- sem(sem_model, data = data_SI)

summary(fit, fit.measures = F)
```

### Mediation: Potentially greenwashed investment (self-reported)

```{r}

data_SI$check_gw_0_1 <- (data_SI$check_gw-1)/4

sem_model <- '
  # Direct paths
  check_gw_0_1 ~ b1*subjective_ability_SFL + b2*gw_belief +c*sfl
  subjective_ability_SFL ~ a1*sfl
  gw_belief ~ a2*sfl


  # Indirect paths (mediation)
  indirect1 := a1 * b1
  indirect2 := a2 * b2
  total_indirect := indirect1 + indirect2  
  total_effect := c + (indirect1 + indirect2)
'

fit <- sem(sem_model, data = data_SI)

summary(fit, fit.measures = F)


```

## Revised investments

### All participants who invested sustainably

```{r results = "asis"}
data_SI <- data %>% 
  dplyr::filter(SI_investment_decision !=0)

data_table <- data_SI %>% subset(select=c(SMP_investment_decision, SMP_revised_investment,
                            SI_investment_decision,SI_revised_investment,
                            GW_investment_decision,GW_revised_investment,
                            diff_SMP, diff_SI, diff_GW, 
                            investmentdecision_A , revisedinvestment_A,
                            investmentdecision_B , revisedinvestment_B,
                            investmentdecision_C , revisedinvestment_C,
                            investmentdecision_D , revisedinvestment_D,
                            investmentdecision_S , revisedinvestment_S,
                            diff_Fonds_A:diff_Fonds_S))

tabl <- tableby( ~ ., data = data_table, numeric.stats = c("meansd"), 
                numeric.simplify=T)

summary(tabl, text = T, digits = 2)









```

### Participants who invested sustainably and changed their decision

```{r results = "asis"}
data_SI <- data %>% 
  dplyr::filter(SI_investment_decision !=0) %>% dplyr::filter(no_diff_inv_rev == 0)


data_table <- data_SI %>% subset(select=c(SMP_investment_decision, SMP_revised_investment,
                            SI_investment_decision,SI_revised_investment,
                            GW_investment_decision,GW_revised_investment,
                            diff_SMP, diff_SI, diff_GW, 
                            investmentdecision_A , revisedinvestment_A,
                            investmentdecision_B , revisedinvestment_B,
                            investmentdecision_C , revisedinvestment_C,
                            investmentdecision_D , revisedinvestment_D,
                            investmentdecision_S , revisedinvestment_S,
                            diff_Fonds_A:diff_Fonds_S))

tabl <- tableby( ~ ., data = data_table, numeric.stats = c("meansd"), 
                numeric.simplify=T)

summary(tabl, text = T, digits = 2)









```

## Reasons for revision greenwashed investment

```{r}

cm <- c("SMP_investment_decision" = "Stock market participation: initial",
        "SI_investment_decision" = "Sustainable investments: initial",
        "GW_investment_decision" = "Greenwashed investments: initial",
        "sfl" = "Sustainable finance literacy",
        "FL_advanced" = "Advanced financial literacy",
        "reasonproSIasset" = "ESG reason",
        "gender" = "Female (ref = male)",
        "age" = "Age in years",
        "university_degree" = "University degree (ref = no)",
        "high_income" = "High household income",
        "hhincome_not_reported" = "Household income not reported",
        "experience" = "Investment experience in years",
        "SHI" = "Stockholder image",
        "SMI_immorality" = "Stock market image: Immorality",
        "SMI_wealth_creation" = "Stock market image: Wealth creation",
        "SMI_esg" = "Stock market image: ESG",
        "hassle_sust" = "Hassle factor",
        "gw_belief" = "Greenwashing beliefs",
        "bio_values" = "Biospheric Values",
        "alt_values" = "Altruistic Values",
        "risk_taking" = "Risk taking",
        "patience" = "Patience",
        "trust_general" = "General trust",
        "left_wing" = "Left wing views",
        "(Intercept)" = "Constant")

m1 <- lm(diff_Fonds_C ~ sfl + FL_advanced + reasonproSIasset+
           gender + age + university_degree + high_income + hhincome_not_reported + 
           experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg + 
           hassle_sust + gw_belief + 
           bio_values + alt_values + risk_taking + patience + trust_general + 
           left_wing , data_SI)


m2 <- lm(diff_Fonds_C ~ sfl + FL_advanced +reasonproSIasset+ SMP_investment_decision + 
           SI_investment_decision + GW_investment_decision+
           gender + age + university_degree + high_income + hhincome_not_reported + 
           experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg + 
           hassle_sust + gw_belief + 
           bio_values + alt_values + risk_taking + patience + trust_general + 
           left_wing , data_SI)

data_SI$no_diff_Fund_C <- ifelse(data_SI$diff_Fonds_C >= 0, 1, 0)

m3 <- glm(no_diff_Fund_C ~ sfl + FL_advanced +reasonproSIasset + SMP_investment_decision + 
            SI_investment_decision + GW_investment_decision+
            gender + age + university_degree + high_income + hhincome_not_reported + 
            experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg + 
            hassle_sust + gw_belief + 
            bio_values + alt_values + risk_taking + patience + trust_general + 
            left_wing, family = "binomial" , data_SI)

gof_map <- c(
  n = "nobs",
  r2 = "r.squared",
  "r2 adj" = "adj.r.squared"
)



modelsummary(list(m1,m2,m3),
             coef_map = cm,  gof_map = gof_map,
             stars = c("+" = .1, "*" = .05, "**" = .01, "***" = .001),
             )
```

## Robustness checks

### Stock market investments

```{r}
data_rob <- data %>% dplyr::filter(email_not_provided == 0) %>%
  dplyr::filter(sfl_only_dk != 1) %>% 
  dplyr::filter(FLa_only_dk != 1) %>% 
  dplyr::filter(timing_investment != 1) %>% 
  dplyr::filter(timing_sfl != 1)

m1 <- lm(SMP_investment_decision ~ sfl + FL_advanced, data_rob)


m2 <- lm(SMP_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported + 
           experience, data_rob)

m3 <- lm(SMP_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported + 
           experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg, data_rob)

m4 <- lm(SMP_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported + 
           experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg + 
           hassle_sust + gw_belief, data_rob)

m5 <- lm(SMP_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported + 
           experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg + 
           hassle_sust + gw_belief + bio_values + alt_values + risk_taking + 
           patience + trust_general + 
           left_wing , data_rob)

m6 <- lm(SMP_investment_decision ~ sfl, data_rob)
m7 <- lm(SMP_investment_decision ~ FL_advanced, data_rob)

cm <- c("sfl" = "Sustainable finance literacy",
        "FL_advanced" = "Advanced financial literacy",
        "gender" = "Female (ref = male)",
        "age" = "Age in years",
        "university_degree" = "University degree (ref = no)",
        "high_income" = "High household income",
        "hhincome_not_reported" = "Household income not reported",
        "experience" = "Investment experience in years",
        "SHI" = "Stockholder image",
        "SMI_immorality" = "Stock market image: Immorality",
        "SMI_wealth_creation" = "Stock market image: Wealth creation",
        "SMI_esg" = "Stock market image: ESG",
        "hassle_sust" = "Hassle factor",
        "gw_belief" = "Greenwashing beliefs",
        "bio_values" = "Biospheric Values",
        "alt_values" = "Altruistic Values",
        "risk_taking" = "Risk taking",
        "patience" = "Patience",
        "trust_general" = "General trust",
        "left_wing" = "Left wing views",
        "(Intercept)" = "Constant")


row <- data.frame(term = "Wald test: SFL = Advanced FL", m7 = "", m6 = "", 
                  m1 = linearHypothesis(m1, "sfl = FL_advanced")[2,"Pr(>F)"],
                  m2 = linearHypothesis(m2, "sfl = FL_advanced")[2,"Pr(>F)"],
                  m3 = linearHypothesis(m3, "sfl = FL_advanced")[2,"Pr(>F)"],
                  m4 = linearHypothesis(m4, "sfl = FL_advanced")[2,"Pr(>F)"],
                  m5 = linearHypothesis(m5, "sfl = FL_advanced")[2,"Pr(>F)"])


gof_map <- c(
  n = "nobs",
  r2 = "r.squared",
  "r2 adj" = "adj.r.squared"
)


modelsummary(list(m7,m6,m1, m2,m3,m4,m5), add_rows = row, 
             coef_map = cm, gof_map = gof_map,
             stars = c("+" = .1, "*" = .05, "**" = .01, "***" = .001))



```

### Sustainable investments

```{r}

m1 <- lm(SI_investment_decision ~ sfl + FL_advanced, data_rob)

m2 <- lm(SI_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported + 
           experience, data_rob)

m3 <- lm(SI_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported + 
           experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg, data_rob)

m4 <- lm(SI_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported + 
           experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg +
           hassle_sust + gw_belief, data_rob)

m5 <- lm(SI_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported + 
           experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg + 
           hassle_sust + gw_belief +  bio_values + alt_values + risk_taking + 
           patience + trust_general + 
           left_wing, data_rob)

m6 <- lm(SI_investment_decision ~ sfl, data_rob)
m7 <- lm(SI_investment_decision ~ FL_advanced, data_rob)

row <- data.frame(term = "Wald test: SFL = Advanced FL", m7 = "", m6 = "", 
                  m1 = linearHypothesis(m1, "sfl = FL_advanced")[2,"Pr(>F)"],
                  m2 = linearHypothesis(m2, "sfl = FL_advanced")[2,"Pr(>F)"],
                  m3 = linearHypothesis(m3, "sfl = FL_advanced")[2,"Pr(>F)"],
                  m4 = linearHypothesis(m4, "sfl = FL_advanced")[2,"Pr(>F)"],
                  m5 = linearHypothesis(m5, "sfl = FL_advanced")[2,"Pr(>F)"])


modelsummary(list(m7,m6,m1, m2,m3,m4,m5), add_rows = row, 
             coef_map = cm, gof_map = gof_map,
             stars = c("+" = .1, "*" = .05, "**" = .01, "***" = .001))

```

### Greenwashed investments

```{r}

data_rob_SI <- data_rob %>% 
  dplyr::filter(SI_investment_decision !=0)


m1 <- lm(GW_investment_decision ~ sfl + FL_advanced, data_rob_SI)


m2 <- lm(GW_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported + 
           experience, data_rob_SI)

m3 <- lm(GW_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported + 
           experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg, data_rob_SI)

m4 <- lm(GW_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported + 
           experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg + 
           hassle_sust + gw_belief, data_rob_SI)

m5 <- lm(GW_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported + 
           experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg + 
           hassle_sust + gw_belief +  bio_values + alt_values + risk_taking + 
           patience + trust_general + left_wing, data_rob_SI)

m6 <- lm(GW_investment_decision ~ sfl, data_rob_SI)
m7 <- lm(GW_investment_decision ~ FL_advanced, data_rob_SI)

row <- data.frame(term = "Wald test: SFL = Advanced FL", m7 = "", m6 = "", 
                  m1 = linearHypothesis(m1, "sfl = FL_advanced")[2,"Pr(>F)"],
                  m2 = linearHypothesis(m2, "sfl = FL_advanced")[2,"Pr(>F)"],
                  m3 = linearHypothesis(m3, "sfl = FL_advanced")[2,"Pr(>F)"],
                  m4 = linearHypothesis(m4, "sfl = FL_advanced")[2,"Pr(>F)"],
                  m5 = linearHypothesis(m5, "sfl = FL_advanced")[2,"Pr(>F)"])

modelsummary(list(m7,m6,m1, m2,m3,m4,m5), add_rows = row, 
             coef_map = cm, gof_map = gof_map,
             stars = c("+" = .1, "*" = .05, "**" = .01, "***" = .001))


```

### Five-question inventory

```{r}

cm <- c("sfl5" = "Sustainable finance literacy (5 items)",
        "FL_advanced" = "Advanced financial literacy",
        "gender" = "Female (ref = male)",
        "age" = "Age in years",
        "university_degree" = "University degree (ref = no)",
        "high_income" = "High household income",
        "hhincome_not_reported" = "Household income not reported",
        "experience" = "Investment experience in years",
        "SHI" = "Stockholder image",
        "SMI_immorality" = "Stock market image: Immorality",
        "SMI_wealth_creation" = "Stock market image: Wealth creation",
        "SMI_esg" = "Stock market image: ESG",
        "hassle_sust" = "Hassle factor",
        "gw_belief" = "Greenwashing beliefs",
        "bio_values" = "Biospheric Values",
        "alt_values" = "Altruistic Values",
        "risk_taking" = "Risk taking",
        "patience" = "Patience",
        "trust_general" = "General trust",
        "left_wing" = "Left wing views",
        "(Intercept)" = "Constant")


m2 <- lm(SMP_investment_decision ~ sfl5, data)
m1 <- lm(SMP_investment_decision ~ FL_advanced, data)
m3 <- lm(SMP_investment_decision ~ sfl5 + FL_advanced, data)
m4 <- lm(SMP_investment_decision ~ sfl5 + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported + 
           experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg + 
           hassle_sust + gw_belief + bio_values + alt_values + risk_taking + 
           patience + trust_general + left_wing , data)


m6 <- lm(SI_investment_decision ~ sfl5, data)
m5 <- lm(SI_investment_decision ~ FL_advanced, data)
m7 <- lm(SI_investment_decision ~ sfl5 + FL_advanced, data)
m8 <- lm(SI_investment_decision ~ sfl5 + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported + 
           experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg + 
           hassle_sust + gw_belief + bio_values + alt_values + risk_taking + 
           patience + trust_general + left_wing , data)


data_SI <- data %>% 
  dplyr::filter(SI_investment_decision !=0)

m10 <- lm(GW_investment_decision ~ sfl5, data_SI)
m9 <- lm(GW_investment_decision ~ FL_advanced, data_SI)
m11 <- lm(GW_investment_decision ~ sfl5 + FL_advanced, data_SI)
m12 <- lm(GW_investment_decision ~ sfl5 + FL_advanced + 
            gender + age + university_degree + high_income + 
            hhincome_not_reported + experience + SHI + SMI_immorality + 
            SMI_wealth_creation + SMI_esg + hassle_sust + gw_belief + 
            bio_values + alt_values + risk_taking + patience + trust_general + 
            left_wing, data_SI)

gof_map <- c(
  n = "nobs",
  r2 = "r.squared",
  "r2 adj" = "adj.r.squared"
)

modelsummary(list(m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12), coef_map = cm, 
             gof_map = gof_map,
             stars = c("+" = .1, "*" = .05, "**" = .01, "***" = .001))



```

### Gender split

```{r}

m1 <- feols(SMP_investment_decision ~ sfl + FL_advanced, fsplit="gender", data)

m2 <- feols(SMP_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported + 
             experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg + 
             hassle_sust + gw_belief + 
           bio_values + alt_values + risk_taking + patience + trust_general + 
             left_wing, fsplit="gender" , data)

m3 <- feols(SI_investment_decision ~ sfl + FL_advanced, fsplit="gender", data)


m4 <- feols(SI_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported + 
             experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg + 
             hassle_sust + gw_belief + 
           bio_values + alt_values + risk_taking + patience + trust_general + 
             left_wing, fsplit="gender", data)

m5 <- feols(GW_investment_decision ~ sfl + FL_advanced, fsplit="gender", data_SI)


m6 <- feols(GW_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported + 
             experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg + 
             hassle_sust + gw_belief + 
           bio_values + alt_values + risk_taking + patience + trust_general + 
             left_wing, fsplit="gender", data_SI)

cm <- c("sfl" = "Sustainable finance literacy",
        "FL_advanced" = "Advanced financial literacy",
        "gender" = "Female (ref = male)",
        "age" = "Age in years",
        "university_degree" = "University degree (ref = no)",
        "high_income" = "High household income",
        "hhincome_not_reported" = "Household income not reported",
        "experience" = "Investment experience in years",
        "SHI" = "Stockholder image",
        "SMI_immorality" = "Stock market image: Immorality",
        "SMI_wealth_creation" = "Stock market image: Wealth creation",
        "SMI_esg" = "Stock market image: ESG",
        "hassle_sust" = "Hassle factor",
        "gw_belief" = "Greenwashing beliefs",
        "bio_values" = "Biospheric Values",
        "alt_values" = "Altruistic Values",
        "risk_taking" = "Risk taking",
        "patience" = "Patience",
        "trust_general" = "General trust",
        "left_wing" = "Left wing views",
        "(Intercept)" = "Constant")

gof_map <- c(
  n = "nobs",
  r2 = "r.squared",
  "r2 adj" = "adj.r.squared"
)
modelsummary(list(m2,m4,m6), coef_map = cm, gof_map = gof_map,
             stars = c("+" = .1, "*" = .05, "**" = .01, "***" = .001))




```

### Split by financial market participation: Stock market investments

```{r}


data_SMP <- data %>% dplyr::filter(stock_market_participant == 1)
data_no_SMP <- data %>% dplyr::filter(stock_market_participant == 0)

m1 <- lm(SMP_investment_decision ~ FL_advanced, data_SMP)
m2 <- lm(SMP_investment_decision ~ sfl, data_SMP)
m3 <- lm(SMP_investment_decision ~ sfl + FL_advanced, data_SMP)
m4 <- lm(SMP_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported  
         + experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg +
           hassle_sust + 
           gw_belief + bio_values + alt_values + risk_taking + patience + 
           trust_general + left_wing , data_SMP)


m5 <- lm(SMP_investment_decision ~ FL_advanced, data_no_SMP)
m6 <- lm(SMP_investment_decision ~ sfl, data_no_SMP)
m7 <- lm(SMP_investment_decision ~ sfl + FL_advanced, data_no_SMP)
m8 <- lm(SMP_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported  + 
           SHI + SMI_immorality + SMI_wealth_creation + SMI_esg + hassle_sust + 
           gw_belief + bio_values + alt_values + risk_taking + patience + 
           trust_general + left_wing , data_no_SMP)



gof_map <- c(
  n = "nobs",
  r2 = "r.squared",
  "r2 adj" = "adj.r.squared"
)



modelsummary(list(m1, m2,m3,m4,m5,m6,m7,m8), 
             coef_map = cm, gof_map = gof_map,
             stars = c("+" = .1, "*" = .05, "**" = .01, "***" = .001))

```

### Split by financial market participation: Sustainable investments

```{r}


data_SMP <- data %>% dplyr::filter(stock_market_participant == 1)
data_no_SMP <- data %>% dplyr::filter(stock_market_participant == 0)

m1 <- lm(SI_investment_decision ~ FL_advanced, data_SMP)
m2 <- lm(SI_investment_decision ~ sfl, data_SMP)
m3 <- lm(SI_investment_decision ~ sfl + FL_advanced, data_SMP)
m4 <- lm(SI_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported  
         + experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg +
           hassle_sust + 
           gw_belief + bio_values + alt_values + risk_taking + patience + 
           trust_general + left_wing , data_SMP)


m5 <- lm(SI_investment_decision ~ FL_advanced, data_no_SMP)
m6 <- lm(SI_investment_decision ~ sfl, data_no_SMP)
m7 <- lm(SI_investment_decision ~ sfl + FL_advanced, data_no_SMP)
m8 <- lm(SI_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported  + 
           SHI + SMI_immorality + SMI_wealth_creation + SMI_esg + hassle_sust + 
           gw_belief + bio_values + alt_values + risk_taking + patience + 
           trust_general + left_wing , data_no_SMP)



gof_map <- c(
  n = "nobs",
  r2 = "r.squared",
  "r2 adj" = "adj.r.squared"
)



modelsummary(list(m1, m2,m3,m4,m5,m6,m7,m8), 
             coef_map = cm, gof_map = gof_map,
             stars = c("+" = .1, "*" = .05, "**" = .01, "***" = .001))

```

### Split by financial market participation: Potentially greenwashed investments

```{r}


data_SMP_SI <- data_SMP %>% 
  dplyr::filter(SI_investment_decision !=0)

data_no_SMP_SI <- data_no_SMP %>% 
  dplyr::filter(SI_investment_decision !=0)


m1 <- lm(GW_investment_decision ~ FL_advanced, data_SMP_SI)
m2 <- lm(GW_investment_decision ~ sfl, data_SMP_SI)
m3 <- lm(GW_investment_decision ~ sfl + FL_advanced, data_SMP_SI)
m4 <- lm(GW_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported  
         + experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg +
           hassle_sust + 
           gw_belief + bio_values + alt_values + risk_taking + patience + 
           trust_general + left_wing , data_SMP_SI)


m5 <- lm(GW_investment_decision ~ FL_advanced, data_no_SMP_SI)
m6 <- lm(GW_investment_decision ~ sfl, data_no_SMP_SI)
m7 <- lm(GW_investment_decision ~ sfl + FL_advanced, data_no_SMP_SI)
m8 <- lm(GW_investment_decision ~ sfl + FL_advanced + 
           gender + age + university_degree + high_income + hhincome_not_reported  + 
           SHI + SMI_immorality + SMI_wealth_creation + SMI_esg + hassle_sust + 
           gw_belief + bio_values + alt_values + risk_taking + patience + 
           trust_general + left_wing , data_no_SMP_SI)



gof_map <- c(
  n = "nobs",
  r2 = "r.squared",
  "r2 adj" = "adj.r.squared"
)



modelsummary(list(m1, m2,m3,m4,m5,m6,m7,m8), 
             coef_map = cm, gof_map = gof_map,
             stars = c("+" = .1, "*" = .05, "**" = .01, "***" = .001))

```

### Self-reported investment behavior

```{r message = F, warning=F}

data_SI_actual <- data %>% dplyr::filter(assets_sust_perc != 0)


m1 <- polr(factor(assets_percent) ~ FL_advanced, data)
m2 <- polr(factor(assets_percent) ~ sfl, data)
m3 <- polr(factor(assets_percent) ~ sfl + FL_advanced, data)
m4 <- polr(factor(assets_percent) ~ sfl + FL_advanced + 
             gender + age + university_degree + high_income + 
             hhincome_not_reported + experience + SHI + SMI_immorality +
             SMI_wealth_creation + SMI_esg + hassle_sust + gw_belief + 
             bio_values + alt_values + risk_taking + patience + trust_general + 
             left_wing , data)

m5 <- polr(factor(assets_sust_perc) ~ FL_advanced, data)
m6 <- polr(factor(assets_sust_perc) ~ sfl, data)
m7 <- polr(factor(assets_sust_perc) ~ sfl + FL_advanced, data)
m8 <- polr(factor(assets_sust_perc) ~ sfl + FL_advanced + 
             gender + age + university_degree + high_income + hhincome_not_reported + 
             experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg + 
             hassle_sust + gw_belief + 
             bio_values + alt_values + risk_taking + patience + trust_general + 
             left_wing , data)


m9 <- polr(factor(check_gw) ~ FL_advanced, data_SI_actual)
m10 <- polr(factor(check_gw) ~ sfl, data_SI_actual)
m11 <- polr(factor(check_gw) ~ sfl + FL_advanced, data_SI_actual)
m12 <- polr(factor(check_gw) ~ sfl + FL_advanced + 
             gender + age + university_degree + high_income + hhincome_not_reported + 
              experience + SHI + SMI_immorality + SMI_wealth_creation + SMI_esg + 
              hassle_sust + gw_belief + 
             bio_values + alt_values + risk_taking + patience + trust_general + 
              left_wing , data_SI_actual)


row <- data.frame(term = "Wald test: SFL = Advanced FL", m1 = "", m2 = "", 
                  m3 = linearHypothesis(m3, "sfl = FL_advanced")[2,"Pr(>Chisq)"],
                  m4 = linearHypothesis(m4, "sfl = FL_advanced")[2,"Pr(>Chisq)"],
                  m5 = "", m6 = "",
                  m7 = linearHypothesis(m7, "sfl = FL_advanced")[2,"Pr(>Chisq)"],
                  m8 = linearHypothesis(m8, "sfl = FL_advanced")[2,"Pr(>Chisq)"],
                  m9 = "", m10 = "",
                  m11 = linearHypothesis(m11, "sfl = FL_advanced")[2,"Pr(>Chisq)"],
                  m12 = linearHypothesis(m12, "sfl = FL_advanced")[2,"Pr(>Chisq)"])

row2 <- data.frame(term = "Nagelkerke PseudoR2", 
                  m1 = round(PseudoR2(m1, c("Nagel")),3),
                  m2 = round(PseudoR2(m2, c("Nagel")),3),
                  m3 = round(PseudoR2(m3, c("Nagel")),3),
                  m4 = round(PseudoR2(m4, c("Nagel")),3),
                  m5 = round(PseudoR2(m5, c("Nagel")),3),
                  m6 = round(PseudoR2(m6, c("Nagel")),3),
                  m7 = round(PseudoR2(m7, c("Nagel")),3),
                  m8 = round(PseudoR2(m8, c("Nagel")),3),
                  m9 = round(PseudoR2(m9, c("Nagel")),3),
                  m10 = round(PseudoR2(m10, c("Nagel")),3),
                  m11 = round(PseudoR2(m11, c("Nagel")),3),
                  m12 = round(PseudoR2(m12, c("Nagel")),3))



row <- rbind(row, row2)


gof_map_short <- c(
  n = "nobs"
)

modelsummary(list(m1, m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12), add_rows = row,
             coef_map = cm, gof_map = gof_map_short,
             stars = c("+" = .1, "*" = .05, "**" = .01, "***" = .001))




```
